home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGSCAL / TBUTIL1.LZH / TURBO-UT.PAS < prev    next >
Pascal/Delphi Source File  |  1984-09-11  |  4KB  |  113 lines

  1. {.HETURBO-UT.PAS : Pascal tools for application development            #}
  2. { * TURBO-UT.PAS ram/rom *                                }
  3. { * by Don Ramsey and Larry Romero *                   }
  4. { * March-April-May 1984 *                             }
  5.  
  6. program turbo_ut;
  7.  
  8.  {$I UT-MOD00.INC }   { load global variables }
  9.  
  10. {**********************************************************}
  11. {*  Shell-Module 01                                       *}
  12. {*  Purpose:            Misc. utilities and commands      *}
  13. {**********************************************************}
  14.  
  15.  {$I UT-MOD01.INC }
  16.  
  17. {**********************************************************}
  18. {*  Shell-Module 02                                       *}
  19. {*  Purpose: Input procedures and commands.               *}
  20. {*       These modules are required for use with          *}
  21. {*       the Input Procedure but can be used any time.    *}
  22. {**********************************************************}
  23.  
  24.  {$I UT-MOD02.INC }
  25.  
  26. {******************************************************************}
  27. {*  Shell-Module 03                                               *}
  28. {*  Purpose : Handle Variables for the Input procedure.           *}
  29. {*      These routines handle all input for NEW variables and     *}
  30. {*      CHANGES for old inputs. They handle all prompting,        *}
  31. {*      defaults, and validation.                                 *}
  32. {******************************************************************}
  33.  
  34.  {$I UT-MOD03.INC }
  35.  
  36. {******************************************************************}
  37. {*  Shell-Module 04                                               *}
  38. {*  Purpose : Provide a Lotus Type Menu.                          *}
  39. {*      This routine handles all Menu Selections and Prompting    *}
  40. {*      for a Lotus Menu. Ths programmer provides Selections      *}
  41. {*      and prompts before calling the routine.                   *}
  42. {*  Requires Global Procedures:                                   *}
  43. {*      Set_Cap_Num, Ck_edit_key                                  *}
  44. {******************************************************************}
  45.  
  46.  {$I UT-MOD04.INC }
  47.  
  48. {.pa}
  49. {************************************************************}
  50. {*  Source Code Module: UT-MOD90                            *}
  51. {*  Purpose:            Main Menu Module : Program Control  *}
  52. {************************************************************}
  53.  
  54. procedure ProgramExit;
  55.  begin
  56.    Clrscr; Center('This Program is about to end',1,11,80);
  57.    highvideo; Center('Verify Ok (Y/N)',1,13,80); lowvideo;
  58.    repeat
  59.      Option; if not (Ch in ['Y','N']) then beep(350,150);
  60.    until Ch in ['Y','N'];
  61.  end;
  62.  
  63. procedure MainMenu;
  64.  var I,Tab: integer;
  65.      Okchoices: set of char;
  66.   begin
  67.    if First_run then
  68.     begin
  69.      ClrScr; HighVideo;
  70.      Center('*** MAIN  MENU ***  ',1,4,80); LowVideo;
  71.      for I:= 1 to 4 do  writeln('');
  72.      Tab:= 25;
  73.      writeln('':Tab,'<1> ');
  74.      writeln('':Tab,'<2> '); writeln('');
  75.      writeln('':Tab,'<3> ');
  76.      writeln('':Tab,'<4> ');   writeln('');
  77.      writeln('':Tab,'<5> ');
  78.      writeln('':Tab,'<6> '); writeln('');
  79.      writeln('':Tab,'<7> Exit the Program'); writeln('');
  80.      Box(20,2,60,20,6);writeln('');
  81.      SaveScreen; First_run:=false;
  82.     end else FlashScreen;
  83.     Set_Cap_num(' ','N',' '); Say_Cap_Num;
  84.     Highvideo; Center('Press Your Selection',21,19,38); LowVideo;
  85.     OKchoices:=['1'..'7'];
  86.     repeat
  87.       Option; if not (Ch in OKchoices) then Beep(350,150);
  88.     until Ch in OKchoices;
  89.     case Ch of
  90.       '1' :  ;
  91.       '2' :  ;
  92.       '3' :  ;
  93.       '4' :  ;
  94.       '5' :  ;
  95.       '6' :  ;
  96.       '7' :  begin
  97.                ProgramExit;
  98.                if Ch='Y' then Exit := true;
  99.              end;
  100.     end; { case }
  101.   end;
  102.  
  103. {**********************************************************}
  104. {*              Program Starts Execution                  *}
  105. {**********************************************************}
  106.  
  107. begin
  108.   ClrScr; Exit:=false; First_run:=true;
  109.   repeat
  110.     MainMenu;
  111.   until Exit = true;
  112. end.
  113.